<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>在线漫画--章节内容浏览</title>
    <link rel="stylesheet" href="../../css/bootstrap-theme.min.css">
    <link rel="stylesheet" href="../../css/bootstrap.min.css">
</head>
<body>
<style>

</style>
<div class="container">
    <div class="page-header">漫画内容预览</div>
    <?php
    // 判断是否有参数
    if(empty($_GET["proId"])){
        die("缺少作品id参数！");
    }
    if(empty($_GET["section"])){
        die("缺少章节序号参数！");
    }
    $proId = $_GET["proId"];
    $section = $_GET["section"];


    //查询作品集数与内容

    $sql= "select production.name,content.imgUrl,content.section,content.sectionName from content inner join production on content.proId=production.id and proId=$proId and section=$section";
    include_once dirname(__FILE__) .'../../common/conn.php';
    $res= mysqli_query($con,$sql);
    mysqli_close($con);
    if(!$res){
        die("查询错误！");
    }
    //判断是否有查到漫画内容
    $row = mysqli_fetch_array($res,1);
    if(!$row){
        die("没有查到此漫画内容，<a href='cList.php'>请重新选择</a>");
    }
    ?>
    <h1>
        <?php echo $row["name"] ?>
    </h1>
    <h2>
        第<?php echo $row["section"] ?>话 <?php echo $row["sectionName"] ?>
    </h2>
<!--    显示漫画内容-->
    <div class="col-sm-offset-2">
        <img src="<?php echo $row["imgUrl"] ?>" />
    </div>
</div>
</body>
</html>